'use strict';

angular.module('SystemManage').controller('UserListController', ['$scope', 'BaseModule', '$location', 'Authentication',
    function($scope, BaseModule, $location, Authentication) {
    	BaseModule.initModule($scope, 'User');
        $scope.Module.User.PageSize = 15;
        $scope.Module.User.Populate = {path: 'Department', select: 'Name'};

        $scope.btnAdd = function(){
        	$location.url('/index/User/Edit');
        };

        $scope.rowDblClick = function(){
        	$scope.$apply(function(){
                $location.url("/index/User/Edit/" + $scope.Module.User.FocusedRecord._id);
            });
        };

        $scope.btnDelete = function(){
        	$scope.Module.User.deleteSelecteds();
        };
    }   
]);
